#ifndef __TRANSLATOR_H__
#define __TRANSLATOR_H__

#include "BaseTypeDefin.h"
#include "Dictionary.h"

#include <queue>
#include <sstream>

typedef queue<int> bufQueue;
class Translator
{
public:
	Translator(Dictionary* pDict);
	~Translator();

	void	DoTranslate(string pNumber);
	wstring	getResult();
protected:
private:
	wstring	translate(string pNumber);
	wstring	makeTranslate(long pValue, int pRank);
	int		searchCurrRankOfValueInDict(long pValue, int pRank, ISearchAlgorithms* _searchAlg);
	bool	searchTranslateForValue(long pValue, int pRank);
	int		countNumberOfVariant(long pValue, int pRank);
	wstring getRigthMethodTranslate(long pValue, int pRank);
	string	searchMinNumberForCompositeValue(string pValue);
	wstring searchLocalTranslate(long pValue, int pRank, ISearchAlgorithms* _searchAlg);

	Dictionary* mDict;
	bufQueue buf;
	
	int		sizeTranslatedNum;
	wstring resultStr;

	bool	ifTranslateZero;
};

#endif __TRANSLATOR_H__